{% extends 'base.html' %}
{% block title %}{{ title }}{% endblock %}
{% block content %}
<h2>{{ title }}</h2>
<form method="post">
    {{ form.hidden_tag() }}
    <div class="mb-3">
        {{ form.student.label(class="form-label") }}
        {{ form.student(class="form-select") }}
        {% for error in form.student.errors %}
            <div class="text-danger">{{ error }}</div>
        {% endfor %}
    </div>
    <div class="mb-3">
        {{ form.course.label(class="form-label") }}
        {{ form.course(class="form-select") }}
        {% for error in form.course.errors %}
            <div class="text-danger">{{ error }}</div>
        {% endfor %}
    </div>
    <div class="mb-3">
        {{ form.score.label(class="form-label") }}
        {{ form.score(class="form-control") }}
        {% for error in form.score.errors %}
            <div class="text-danger">{{ error }}</div>
        {% endfor %}
    </div>
    <div class="mb-3">
        {{ form.grade_status.label(class="form-label") }}
        {{ form.grade_status(class="form-control") }}
        {% for error in form.grade_status.errors %}
            <div class="text-danger">{{ error }}</div>
        {% endfor %}
    </div>
    {{ form.submit(class="btn btn-primary") }}
    <a href="{{ url_for('main.grade_list') }}" class="btn btn-secondary">取消</a>
</form>
{% endblock %}
